namespace Wips.AppService.Authorities.Menus.Requests
{
    /// <summary>
    /// 
    /// </summary>
    public class GetTreeSelectDataByRoleIdResponse
    {
        /// <summary>
        /// 列表项
        /// </summary>
        public List<GetTreeSelectDataByRoleIdInfo> AllItems { get; set; }

        /// <summary>
        /// 已分配的项
        /// </summary>
        public List<string> CheckedKeys { get; set; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="allItems"></param>
        /// <param name="checkedKeys"></param>
        public GetTreeSelectDataByRoleIdResponse(
            List<GetTreeSelectDataByRoleIdInfo> allItems,
            List<string> checkedKeys
        )
        {
            AllItems = allItems;
            CheckedKeys = checkedKeys;
        }
    }

    /// <summary>
    /// 
    /// </summary>
    public class GetTreeSelectDataByRoleIdInfo
    {
        /// <summary>
        /// ID
        /// </summary>
        public string? Id { get; set; }

        /// <summary>
        /// 父级Id
        /// </summary>
        public string? ParentId { get; set; }

        /// <summary>
        /// 标题
        /// </summary>
        public string? Title { get; set; }

        /// <summary>
        /// 值
        /// </summary>
        public string? Value { get; set; }

        /// <summary>
        /// KEY
        /// </summary>
        public string? Key { get; set; }

        /// <summary>
        /// 是否禁用
        /// </summary>
        public bool Disabled { get; set; }

        /// <summary>
        /// 是否是叶子节点
        /// </summary>
        public bool IsLeaf { get; set; }

        /// <summary>
        /// 是否拥有权限
        /// </summary>
        public bool Checked { get; set; }

        /// <summary>
        /// 子项
        /// </summary>
        public List<GetTreeSelectDataByRoleIdInfo> Children { get; set; } = new();

        /// <summary>
        /// 类型，用于区分菜单和操作，1为菜单，2为操作
        /// </summary>
        public int Type { get; set; }
    }
}